package bk;

import java.applet.*;
import java.awt.*;

public class Lab1102 extends Applet{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public void paint(Graphics g)
	{
		int x= 10;
		int y=50;
		do{		
			g.drawRect(x,y,100,100);
			g.drawLine(x,y,x+40,y-40);
			g.drawLine(x+100,y,x+140,y-40);
			g.drawLine(x+100,y+100,x+140,y+60);
			g.drawLine(x+40,y-40,x+140,y-40);
			g.drawLine(x+140,y-40,x+140,y+60);
			if ((x == 10) && (y == 50)) 
			{ 
				x=10; y=200;
			}
			else{
				if ((x == 10) && (y == 200)) 
				{ 
					x=200; y=50;
				}
				else{
					if ((x == 200) && (y == 50)) 
					{ 
						x=200; y=200;
					}
					else{
						x=1;y=1;
					}
				}			
			}			
		} while ( (x != 1) || (y != 1));
	}
}
